<?php

/**
 * statistic actions.
 *
 * @package    WacStorehouse
 * @subpackage statistic
 * @author     JianBinBi
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class statisticActions extends WacCommonActions
{
    /**
     * Executes index action
     *
     * @param sfRequest $request A request object
     */
    public function executeIndex(sfWebRequest $request) {
        $this->forward('default', 'module');
    }

    public function executeProduceStatsChart(sfWebRequest $request) {
        ;
    }

    public function executeTestChart(sfWebRequest $request) {
//        sfConfig::set('sf_web_debug', false);

//        $this->getResponse()->addJavaScript("backend/statistic/testChartAction.js", 'last');
//        $user = $this->context->getUser();
//        $output = "Test output: ".$user->getAttribute("partner_user");
//        return $this->renderText($output);
    }

    public function executeAjaxTest(sfWebRequest $request) {
        $user = $this->context->getUser();
        $output = "Test output: ".$user->getAttribute("partner_user");
//        $output .= "<br/>".print_r($request->getGetParameters(),true);
        $output .= "<br/>".$request->getParameter("visit_start_year");

        $resultSet = array("items"=> array());
        $resultSet["items"][] = array('content' => $output);

        return OutputHelper::getInstance()->outputJsonOrTextFormat($resultSet, $this);

        return $this->renderText($output);
    }
}
